package com.huawei.appgallery.agreementimpl.view.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import o.awg;
import o.ayy;
import o.ll;

public class AbstractBaseActivity extends Activity {
    private SafeBroadcastReceiver ˏ = new SafeBroadcastReceiver(this) {
        final /* synthetic */ AbstractBaseActivity ॱ;

        {
            this.ॱ = r1;
        }

        public void onReceiveMsg(Context context, Intent intent) {
            String action = intent.getAction();
            if ("com.huawei.appmarket.close.tips.protocol".equals(action) && !this.ॱ.isFinishing()) {
                awg.ˎ.ˋ("AbstractBaseActivity", "  CLOSE_PROTOCOL_TIPS_PAGE  ");
                this.ॱ.finish();
            }
            if ("android.intent.action.LOCALE_CHANGED".equals(action) && !this.ॱ.isFinishing()) {
                awg.ˎ.ˋ("AbstractBaseActivity", "  ACTION_LOCALE_CHANGED  ");
                this.ॱ.finish();
            }
        }
    };

    protected void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ayy.ˋ().ˎ(getWindow());
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("android.intent.action.LOCALE_CHANGED");
        registerReceiver(this.ˏ, intentFilter);
        intentFilter = new IntentFilter();
        intentFilter.addAction("com.huawei.appmarket.close.tips.protocol");
        ll.ˏ(this).ˏ(this.ˏ, intentFilter);
    }

    protected void onDestroy() {
        super.onDestroy();
        unregisterReceiver(this.ˏ);
        ll.ˏ(this).ˋ(this.ˏ);
    }
}
